<template>
	<view>
		<view>
			<view class="smart-container">自定义组件内容</view>
			<navigator url="/pages/cardViewPage/cardViewPage">
				<view class="smart-panel-title"><text>1.置顶新闻页面</text></view>
			</navigator>
			<navigator url="/pages/newsPage/newsPage">
				<view class="smart-panel-title"><text>2.三合一新闻页面</text></view>
			</navigator>
		</view>
		<view>
			<view class="smart-container">1.容器</view>
			<view class="smart-panel-title" @click="goDetailPage('viewpage')">view视图</view>
		</view>
		<view>
			<view class="smart-container">2.基础内容</view>
			<navigator url="/pages/components/textview/textview">
				<view class="smart-panel-title"><text>text文本编辑</text></view>
			</navigator>
			<navigator url="/pages/components/icon/icon">
				<view class="smart-panel-title"><text>icon图标</text></view>
			</navigator>
		</view>
		<view>
			<view class="smart-container">3.表单组件</view>
			<navigator url="/pages/components/button/button">
				<view class="smart-panel-title"><text>button按钮</text></view>
			</navigator>
			<navigator url="/pages/components/checkbox/checkbox">
				<view class="smart-panel-title"><text>checkbox多选框</text></view>
			</navigator>
			<view class="smart-panel-title"><text>lable标签组件</text></view>
			<view class="smart-panel-title"><text>input输入框</text></view>
			<view class="smart-panel-title"><text>textarea多行文本输入框</text></view>
			<navigator url="/pages/components/form/form">
				<view class="smart-panel-title"><text>form表单</text></view>
			</navigator>
		</view>
		<view>
			<view class="smart-container">4.导航组件</view>
			<navigator url="/pages/components/navigator/navigator">
				<view class="smart-panel-title"><text>navigator</text></view>
			</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onShow() {
			console.log("组件页onshow");
			uni.getStorage({
				key: 'username',
				success(result) {
					console.log("获取字段成功:" + result);
				},
				fail(errMsg) {
					console.log("获取字段失败:" + JSON.stringify(errMsg));
				}
			})
		},
		methods: {
			goDetailPage(e) {
				if (typeof e === 'string') {
					uni.navigateTo({
						url: '/pages/components/' + e + '/' + e
					});
				} else {
					uni.navigateTo({
						url: e.url
					})
				}
			}

		}
	}
</script>

<style>
	.smart-innel-panel {
		background-color: #aa99ff;
		flex-direction: row;
		align-items: center;
		padding: 12px;
		margin-bottom: 2px;
	}
</style>